'use strict';
 const db = uniCloud.database() //对数据库的对象获取；

exports.main = async (event, context) => {
    const collection = db.collection('record-of-turtle') //对record-of-turtle数据库的获取；
    //event为客户端上传的参数
    console.log('event : ', collection)
 
    // 查找数据 寻找key为 "user_id"
	let res = await collection.where({
		user_id: event.user_id
	}).get()
 
    return {
        code: 200,
        msg: '查询成功',
        data: res
    }
}